package jast.order.config;

import feign.Logger;
import feign.Request;
import jast.order.interceptor.CustomFeignInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Jast
 * @description Feign配置文件
 * @date 2022-02-16 17:05
 */
//@Configuration
public class FeignConfig {

    /**
     * 设置日志等级
     * @return
     */
    @Bean
    public Logger.Level feignLogLevel(){
        return Logger.Level.FULL;
    }

    /**
     * 设置连接超时时间，处理超时时间
     * @return
     */
    @Bean
    public Request.Options options(){
        return new Request.Options(5000,10000);
    }

    /**
     * 自定义拦截器
     * @return
     */
    @Bean
    public CustomFeignInterceptor customFeignInterceptor(){
        return new CustomFeignInterceptor();
    }
}
